package com.jsnu.xiaochi.controller;

import com.jsnu.xiaochi.service.LoginService;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;


@Controller
public class LoginController {
    @Resource
    LoginService loginService;

    @RequestMapping("login")
    public String showLogin(){
        return "login";
    }

    @RequestMapping("loginOut")
    public String userLoginOut(){
        Subject subject=SecurityUtils.getSubject();
        subject.logout();
//        HttpSession session = req.getSession();
//        session.invalidate();
        return "login";
    }
}